﻿using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using CloudShot.Editor.CanvasFigures;

namespace CloudShot.Utils
{
  internal static class CanvasObjectUtils
  {
    public static Rectangle GetGroupBoundingBox(this IEnumerable<CanvasObject> canvasObjects)
    {
      return canvasObjects.Select(x => x.GetBoundingBox()).UnionRectangles();
    }

    //TODO remove this call! and remove IBoundingBoxFigure
    public static Rectangle GetGroupBoundingBox(this IEnumerable<IBoundingBoxFigure> canvasObjects)
    {
      return canvasObjects.Select(x => x.GetBoundingBox()).UnionRectangles();
    }
  }
}